import request from '@/utils/request'

// 获取所有角色列表
/**
 *
 *
 */
export const getRoles = (data) => {
  return request.get('/sys/role', { params: data })
}

// 根据ID获取角色详情
export const getRolesDetail = id => {
  return request.get(`/sys/role/${id}`)
}

// 添加角色
export const addRoles = data => {
  return request.post(`/sys/role`, data)
}

// 根据ID更新角色
export const editRoles = data => {
  return request.put(`/sys/role/${data.id}`, data)
}

// 根据ID删除角色
export const delRoles = id => {
  return request.delete(`/sys/role/${id}`)
}

// 给角色分配权限
export const assignPrem = data => {
  return request.put(`/sys/role/assignPrem`, data)
}
